Common Linux Commands
The following commands are the most commonly used, and are listed here by category. We acknowledge the categories as developed by
A couple of excellent Linux command books are Scott Hawkins, "Linux Desk Reference," Prentice Hall PTR, (c) 2000 and Linux in an Nutshell," by Ellen Siever. Published by O'Reilly, 1999.
A tutorial approach to Linux commands is Bob Rankin's "The No B.S. Guide To Linux," published by No Starch Press, San Francisco, 1997.
Open Source documents that have good coverage of Linux commands include:
-
The Linux User's Guide, by Larry Greenfield
-
Linux Installation and Getting Started, by Matt Welsh, Phil Hughes, et. al.
-
Unix is a Four Letter Word... and Vi is a Two Letter Abbreviation, by Christopher C. Taylor
Numbers in parentheses following many of the commands corresponds to the section of the man pages where the command is found
Man page sections are arranged as follows:
(1) User Commands
(2) UNIX system calls
(3) Programming Subroutines
(4) Devices
(5) File Formats
(6) Games
(7) Miscellaneous
(8) System Administration (9) Linux-specific system calls
Documentation Commands
Documentation Commands
|
Command
|
Description
|
apropos
|
Search the whatis database. Useful but a lot of it's data is inaccurate
|
info
|
Provide hypertext documentation
|
locate
|
Search for a file in the locate database
|
makewhatis
|
Create the whatis database
|
man
|
Access on-line manual pages
|
updatedb
|
Update the locate database
|
whatis
|
Search the whatis database for information
|
whereis
|
Locate source files and documentation
|
File Commands
File Commands
|
Command
|
Description
|
chgrp
|
Change the group ownership of the file
|
chmod
|
Change the mode (access permissions) of the file
|
chown
|
Change the owner of the file
|
cksum
|
Calculate the checksum of a the file
|
cp
|
Copy the file
|
file
|
Determine file type
|
install
|
Copy file(s), preserving permissions
|
ln
|
Create a link to a file
|
lockfile
|
Create a semaphore
|
ls
|
List the contents of a directory
|
lsattr
|
List the attributes of a file
|
mv
|
Rename a file
|
pathchk
|
Cheek filename for portability
|
rm
|
Remove (delete) a file
|
sum
|
Calculate a checksum
|
touch
|
Update access times or, potentially, create a file
|
Process Commands
Process Commands
|
Command
|
Description
|
&
|
Run the specified process in the background
|
^Z
|
Suspend the current foreground process
|
bg
|
Put the specified process in the background
|
fg
|
Bring a specified process to the foreground
|
fuser
|
Display the pid of any process using a specified file
|
jobs
|
Display a list of background processes
|
kill
|
Stop the execution of a process
|
killall
|
Kill all processes executing a specified command
|
nohup
|
Run a process that will ignore signaling
|
pidof
|
Locate and print the process id of the specified program
|
ps
|
Get process status information
|
pstree
|
Display family tree of running processes
|
renice
|
Change the nice level of a running process
|
top
|
Display CPU usage information, mem usage, size, CPU time, priority, nice level, users, pid, etc
|
Standard Input, Output, And Error Commands
Standard Input, Output, and Error Commands
|
Command
|
Description
|
2>
|
Redirect standard error as specified
|
<
|
Read standard input from a file
|
>
|
Send standard output to a file
|
>>
|
Append standard output to the specified file
|
script
|
Save the activity on your screen in a file
|
tee
|
Copy standard input to a file and also to standard output
|
xargs
|
Read multiple arguments from standard input and use them as arguments to some specified command
|
|
|
Couple the standard output of one program to the standard input of another program
|
Directories Commands
Directories Commands
|
Command
|
Description
|
cd
|
Change directories
|
mkdir
|
Create a new directory
|
pwd
|
Print the current working directory
|
rmdir
|
Remove the specified directory
|
symlinks
|
Find symbolic links
|
User Commands
User Commands
|
Command
|
Description
|
finger
|
Display' information about a user. May be turned off by default
|
groupmod
|
Modify information in the system group files
|
grpck
|
Check system group files for validity
|
id
|
Display information about a user
|
passwd
|
Change a user's password
|
pwck
|
Check system password files for validity
|
su
|
Change to root or another user id
|
useradd
|
Add a new user to the system
|
userdel
|
Delete a user from the system
|
usermod
|
Modify user information on the system
|
users
|
Display a list of current users
|
who
|
Display a list of current users
|
Terminal and Keyboard Commands
Terminal and Keyboard Commands
|
Command
|
Description
|
captoinfo
|
Convert a termcap entry to a terminfo entry
|
clear
|
Clear the terminal screen
|
dumpkeys
|
Display a copy of keyboard translation table
|
getkeycodes
|
Print scancode-to-keycode translation table
|
infocmp
|
Compare or display terminfo entries
|
loadkeys
|
Load keyboard translation table
|
login
|
Initiate user login
|
setterm
|
Set terminal configuration values
|
stty
|
Display or set tty configuration values
|
tic
|
Compile a terminfo entry,
|
tput
|
Access terminal information
|
tset
|
Set terminal information
|
Disk Commands
Disk Commands
|
Command
|
Description
|
badblocks
|
Test a disk for bad blocks
|
cfdisk
|
Partition a disk
|
du
|
Display information about disk usage
|
fdformat
|
Performs a low level format on a floppy, not a normal format as is common for Windows users. Also ensure that it mentions that the device needs to be more specific than /dev/fd0 it would need to be something like /dev/fd0H1440
|
fdisk
|
Partition a disk
|
quota
|
Display or set disk quotas, provided quotas are in your kernel
|
setfdprm
|
Set floppy disk parameters
|
Filesystem Commands
Filesystem Commands
|
Command
|
Description
|
debugfs
|
Inspect and possibly debug a filesystem
|
df
|
Display information about filesystems
|
dumpe2fs
|
Superblock and group information for an etwofs
|
e2fsck
|
Consistency check on an etwofs
|
fsck
|
Consistency cheek on a filesystem
|
fsck.minix
|
Consistency check on a minix filesystem
|
fuser
|
Process ids of processes using the specified filesystems
|
lsattr
|
List attributes of files on filesystem
|
lsof
|
List open files
|
mke2fs
|
Make etwofs filesystem
|
mkfs
|
Make filesystem
|
mkfs.minix
|
Make minix filesystem
|
mklost+found
|
Make lost+found directory on current filesystem
|
mkswap
|
Create swap space on a device
|
mount
|
Mount the current filesystem
|
rdev
|
Display root device. Also can be used to change the root device
|
swapoff
|
Disable swapping
|
swapon
|
Enable swapping
|
sync
|
Write out buffered memory
|
tune2fs
|
Tweak etwofs filesystem parameters
|
umount
|
Unmount a filesystem
|
Print Commands
Print Commands
|
Command
|
Description
|
lpc
|
Control the line printer system
|
lpd
|
The line printer daemon
|
lpq
|
Query the specified print spool
|
lpr
|
Send a file to the print queue
|
lprm
|
Remove a file from the print queue
|
pr
|
Print a file
|
tunelp
|
Modify printer characteristics
|
Daemon Commands
Daemon Commands
|
Command
|
Description
|
fingerd
|
Services finger requests
|
ftpd
|
Services ftp requests
|
identd
|
TCP/IP identification protocol
|
imapd
|
Remote mail access
|
inetd
|
Invokes other daemons, as necessary
|
klogd
|
Kernel log daemon
|
lpd
|
Services line printer requests
|
mountd
|
NFS mount daemon
|
named
|
Internet domain name service
|
pppd
|
Handles point-to-point protocol communication
|
rexecd
|
Remote command execution server
|
rlogin
|
Remote system login
|
rshd
|
Remote command execution
|
rwhod
|
Services rwho/ruptime
|
syslogd
|
System log daemon
|
talk
|
Communication between two users
|
tcpd
|
Access control for Internet services
|
telnetd
|
Services telnet requests
|
tftpd
|
Services tftp requests
|
yppasswdd
|
Changes password
|
Hardware Commands
Hardware Commands
|
Command
|
Description
|
arch
|
System architecture information
|
hostname
|
Set or display hostname information
|
hwclock
|
Set or display hardware clock information
|
uname
|
Machine and operating system information
|
Kernel Commands
Kernel Commands
|
Command
|
Description
|
depmod
|
Create a module dependency list
|
insmod
|
Install a module
|
kerneld
|
Run kernel program in user space
|
ksyms
|
Display kernel symbols
|
lsmod
|
List installed modules
|
modprobe
|
Load or list loadable modules
|
rmmod
|
Remove specified module
|
File Display Commands
File Display Commands
|
Command
|
Description
|
cat
|
Send contents of a file to standard output
|
head
|
Display the top of a file to standard output
|
less
|
Display a file, with scrolling
|
look
|
Display lines which begin with a given string
|
rev
|
Display lines from last character to first
|
tac
|
Display lines in reverse order
|
tail
|
Display the bottom of a file to standard output
|
Compare And Merge File Commands
Compare and Merge File Commands
|
Command
|
Description
|
cmp
|
Compare two files, usually binaries
|
comm
|
Compare two sorted files; outputs common lines
|
diff
|
Show the difference between two files
|
diff3
|
Show the differences between three files
|
sdiff
|
Merge two files
|
Data File Commands
Data File Commands
|
Command
|
Description
|
colrm
|
Remove the specified columns
|
column
|
Format input into columns
|
csplit
|
Split file into sections
|
cut
|
Remove the specified columns from a file
|
expand
|
Expand tabs into spaces
|
fmt
|
Format file to a specified width
|
fold
|
Format file to a specified width
|
merge
|
Merge two descendants of a file
|
paste
|
Merge files horizontally
|
sort
|
Sort file contents
|
split
|
Break big files into smaller files
|
tr
|
Translate characters
|
unexpand
|
Compress spaces into tabs
|
uniq
|
Segregate duplicate lines within a file
|
Document Formatting Commands
Document Formatting Commands
|
Command
|
Description
|
colcrt
|
Display underlines on tables on non-graphic displays
|
eqn
|
Groff equation formatter
|
grog
|
Guess groff options
|
gs
|
Ghostscript typesetting language
|
gxditview
|
Display groff files on X terminal
|
tbl
|
Groff table formatter
|
tex
|
Compile TeX source file
|
troff
|
Document formatter (see groff)
|
xdvi
|
Display .dvi file (see tex) on X Window
|
File Compression and Archive Commands
File Compression and Archive Commands
|
Command
|
Description
|
compress
|
Compress file with Lempel-Ziv encoding
|
cpio
|
Archive files
|
dump
|
Save an entire filesystem
|
gunzip
|
Uncompress a gzipped file
|
gzexe
|
Compress an executable file in place
|
gzip
|
Compress a file
|
restore
|
Restore filesystem saved with dump
|
shar
|
Create a shell archive
|
uncompress
|
Expand compressed file
|
uuencode
|
Encode a file for mail transmission
|
zcmp
|
Compare two zipped files
|
zdiff
|
Compare two zipped files
|
zgrep
|
Search the contents of zipped file(s)
|
zmore
|
Display the contents of zipped file(s)
|
znew
|
Convert from compress format to zip format
|
Startup and Shutdown Commands
Startup and Shutdown Commands
|
Command
|
Description
|
dmesg
|
display bootup messages
|
halt
|
halt the system
|
init
|
set runlevel, or define processes that are begun on a specific runlevel
|
lilo
|
install the LILO boot loader
|
poweroff
|
power the system off'
|
rdev
|
display system startup configuration info
|
reboot
|
reboot the system
|
runlevel
|
show the current system runlevel
|
shutdown
|
bring the system down
|
swapoff
|
disable the paging hardware
|
swapon
|
enable the paging hardware
|
sync
|
write buffered memory out to disk
|
telinit
|
move the system to a new runlevel
|
X Window Commands
X Window Commands
|
Command
|
Description
|
X
|
X Window display server
|
XF86Setup
|
Configure X Window system
|
startx
|
Front-end script for xinit
|
xdm
|
x Display Manager; can handle login
|
xf86config
|
Configure X Window system
|
xinit
|
Start X Window system
|
xmseconfig
|
Configure mouse
|
xterm
|
Start an X-Window
|
xvidtune
|
Tweak video display parameters
|
Scheduling Commands
Scheduling Commands
|
Command
|
Description
|
at
|
Add a job to the scheduling queue
|
atq
|
Display the contents of the scheduling queue
|
atrm
|
Remove a job from the scheduling queue
|
batch
|
Execute queue only when system resources permit
|
crontab
|
Maintain schedule of jobs to be executed
|
sleep
|
Wait some number of seconds
|
usleep
|
Wait some number of microseconds
|
Find File Commands
Find File Commands
|
Command
|
Description
|
egrep
|
Grep with extended regular expressions
|
fgrep
|
Grep variation for matching fixed strings
|
find
|
Search the directory tree
|
finger
|
Display information about a user
|
grep
|
Search for a pattern in a file
|
locate
|
Search the locate database for a file
|
updatedb
|
Update the locate database
|
which
|
Search the directories of your $PATH for a file
|
System Performance and Diagnostics Commands
System Performance and Diagnostics Commands
|
Command
|
Description
|
df
|
Display filesystem information
|
dmesg
|
Display bootup messages
|
free
|
Snapshot of system memory
|
ipcs
|
Shared memory, semaphores, message queues
|
ps
|
Get process information
|
pstree
|
Display process family tree
|
runlevel
|
System runlevel information
|
tload
|
Graph CPU usage information
|
top
|
System usage information
|
vmstat
|
Memory information
|
who
|
User information
|
System Security Commands
System Security Commands
|
Command
|
Description
|
ipchains
|
IP firewall administration
|
Miscellaneous Commands
Miscellaneous Commands
|
Command
|
Description
|
cal
|
Display calendar information
|
date
|
Display' or set time and date
|
ispell
|
Spell checker
|
rpm
|
Red Hat Package manager
|
TCP/IP Commands
TCP/IP Commands
|
Command
|
Description
|
arp
|
Maintain the Address Resolution Protocol table
|
bootpgw
|
bootp gateway
|
bootptab
|
Dump bootp table
|
bootptest
|
Test bootp
|
dip
|
Handle dialup IP links
|
hostname
|
Set or display host name
|
ifconfig
|
Configure network interface
|
in.identd
|
Uses specific TCP/IP connections and returns username, and pocess owning the connection"
|
netstat
|
Network status information
|
nslookup
|
Query Internet domain server
|
rmail
|
Handle mail received via uucp
|
route
|
Display or manipulate IP routing
|
routed
|
Network routing daemon routing is in kernel
|
rusers
|
Similar to who, but works across the network
|
tcpdchk
|
Check TCP wrapper
|
tcpdmatch
|
Predict response to TCP request
|
traceroute
|
Trace route of IP packet from specified host
|
Network Commands
Network Commands
|
Command
|
Description
|
ftp
|
Transfer files between networked machines
|
hostname
|
Display or set name of host
|
netstat
|
Display network usage information
|
ping
|
Request confirmation packed from remote host
|
rcp
|
Remote copying service
|
rdate
|
Get date information across network
|
rdist
|
Distribute files across network
|
rlogin
|
Login to a remote computer
|
rsh
|
Execute a remote shell
|
rusers
|
Network user information
|
rwall
|
Write to all users on network
|
rwho
|
Network user information
|
telnet
|
Remote access to network host
|
NIS and NFS Commands
NIS and NFS Commands
|
Command
|
Description
|
domainname
|
Show or set the system's NIS/YP domain name
|
nisdomainname
|
Show or set system's NIS/YP domain name
|
ypbind
|
NIS client daemon
|
ypcat
|
Display keys from the NIS database
|
ypdomainname
|
Show or set the system's NIS/YP domain name
|
ypinit
|
Initialize a yp server
|
yppasswd
|
Change user-related info
|
yppoll
|
Return version & master server of NIS maps
|
yppush
|
Copy information from master server to slave servers
|
ypserv
|
NIS network services daemon
|
ypset
|
Get NIS information for a domain
|
ypwhich
|
Return the name of the NIS server or map master
|
ypxfer
|
Copy map databases between servers
|
DOS And Windows Commands
DOS And Windows Commands
|
Command
|
Description
|
mattrib
|
Set attributes on an MS-DOS file
|
mbadblocks
|
Test MS-DOS disk for bad blocks
|
mcd
|
Change directories on DOS filesystem
|
mdel
|
Delete file from DOS directory
|
mdeltree
|
Delete directory tree on DOS filesystem
|
mdir
|
Display DOS directory contents
|
mdu
|
Display usage of DOS disk
|
mformat
|
Format DOS disk
|
mlabel
|
Label DOS disk
|
mmd
|
Make DOS directory
|
mmove
|
Move file on DOS filesystem
|
mrd
|
Remove DOS directory
|
mtype
|
Display contents of DOS file
|
nmbd
|
Provide NetBIOS nameserver support
|
smbclient
|
Access Windows machines on the network
|
smbd
|
Provide LanManager services to network clients
|
smbmount
|
Mount LanManager filesystem
|
smbstatus
|
Status information about SMB connection
|
smbumount
|
Unmount LanManager filesystem
|
testparm
|
Test SMB configuration file parameters
|
xcopy
|
Recursively copy contents of DOS directory
|